package com.cjzuji.rental.dao.impl;

import com.cjzuji.rental.dao.OrderContractDao;
import com.cjzuji.rental.dao.XWuContractDao;
import com.cjzuji.rental.mapper.OrderContractMapper;
import com.cjzuji.rental.pojo.OrderContract;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class XWuContractDaoImpl implements XWuContractDao {

    private static final Logger logger = LoggerFactory.getLogger(XWuContractDaoImpl.class);
    @Autowired
    OrderContractMapper orderContractMapper;
    @Override
    @Transactional
    public  void save(List<String> data, Long orderID){
        logger.info(data.get(0).toString());
        OrderContract orderContract = OrderContract.builder()
                .orderId(orderID)
                .contractNo("")
                .title("租赁服务合同")
                .url(data.get(0).toString())
                .addTime("")
                .createTime(new Date())
                .updateTime(new Date())
                .build();
        orderContractMapper.insert(orderContract);
    }
}
